🎖️GitЯра🎖️
Commit 41366bb48d5dc06c1da80d2d723848ec29fb12bc
Parents : bfbf74d
Author : James Rich <2199651+jamesarich@users.noreply.github.com>
Signature : Signature validation error
Date : 2026-07-24T14:13:15-05:00
Committer : GitHub <noreply@github.com>
Date : 2026-07-24T14:13:15-05:00
fix(desktop): restore eager JBR javaHome pin for ProGuard packaging (#6414)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Changes
Diff
diff --git a/desktopApp/build.gradle.kts b/desktopApp/build.gradle.kts
index d218674b4a..29c2869c42 100644
--- a/desktopApp/build.gradle.kts
+++ b/desktopApp/build.gradle.kts
@@ -17,10 +17,6 @@
import dev.detekt.gradle.Detekt
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
-import org.jetbrains.compose.desktop.application.tasks.AbstractCheckNativeDistributionRuntime
-import org.jetbrains.compose.desktop.application.tasks.AbstractJvmToolOperationTask
-import org.jetbrains.compose.desktop.application.tasks.AbstractProguardTask
-import org.jetbrains.compose.desktop.application.tasks.AbstractSuggestModulesTask
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.meshtastic.buildlogic.configureGraphTasks
import org.meshtastic.buildlogic.resolveVersionInfo
@@ -109,29 +105,33 @@ kotlin {
// Exclude generated Compose resource files from detekt analysis
tasks.withType<Detekt>().configureEach { exclude("**/generated/**") }
-// Compose Desktop otherwise derives these task inputs from the JVM running Gradle. Bind only the packaging tasks to a
-// JBR 25 provider so ProGuard and jlink receive jmods without provisioning JBR while unrelated CI tasks configure.
-// Task-type configuration also covers aliases and dependency-driven execution without parsing requested task names.
-val desktopPackagingJavaHome =
- javaToolchains
- .launcherFor {
- languageVersion.set(JavaLanguageVersion.of(25))
- vendor.set(JvmVendorSpec.JETBRAINS)
- }
- .map { launcher -> launcher.metadata.installationPath.asFile.absolutePath }
-
-tasks.withType<AbstractJvmToolOperationTask>().configureEach { javaHome.set(desktopPackagingJavaHome) }
-
-tasks.withType<AbstractProguardTask>().configureEach { javaHome.set(desktopPackagingJavaHome) }
-
-tasks.withType<AbstractSuggestModulesTask>().configureEach { javaHome.set(desktopPackagingJavaHome) }
-
-tasks.withType<AbstractCheckNativeDistributionRuntime>().configureEach { jdkHome.set(desktopPackagingJavaHome) }
-
compose.desktop {
application {
mainClass = "org.meshtastic.desktop.MainKt"
+ // CMP resolves javaHome from the JVM running Gradle, not the Kotlin toolchain. On CI
+ // that's Temurin 25, which ships without jmods (JEP 493): jlink still works, but the
+ // ProGuard task derives -libraryjars from $javaHome/jmods and fails with ~857k
+ // unresolved java.* references. Pin packaging to the JBR SDK toolchain (jmods
+ // included) so ProGuard sees the platform classes and the bundled runtime is
+ // deterministically JBR 25 on every machine.
+ //
+ // This assignment must stay EAGER here on the extension. Deferring it to lazy
+ // `tasks.withType<AbstractProguardTask>().configureEach { javaHome.set(provider) }` (PR #6401)
+ // does not reach `proguardReleaseJars` — the extension value still wins, ProGuard relaunches
+ // under the Gradle JVM, and every Build Desktop leg goes red with the jmods-less signature.
+ javaHome =
+ javaToolchains
+ .launcherFor {
+ languageVersion.set(JavaLanguageVersion.of(25))
+ vendor.set(JvmVendorSpec.JETBRAINS)
+ }
+ .get()
+ .metadata
+ .installationPath
+ .asFile
+ .absolutePath
+
val desktopJvmArgs =
listOf(
"-Xmx2G",
Served by rngit 1.5.2 - Generated in 0.21s